<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<!DOCTYPE html>
<html>
 <head>
  <title>设备信息</title>
  <t:base type="jquery,easyui,tools,DatePicker"></t:base>
  <script type="text/javascript">
  //编写自定义JS代码
  </script>
 </head>
 <script>
 	function selectDevice(){
 		var url = "deviceTypeController.do?goSelect";
 		$.dialog({
 			id:'ss',
 			content: 'url:' + url,
 			lock : true,
 			zIndex: 2062, 
 			width:500,
 			height:280,
 			title:'编辑', 
 			opacity : 0.3,
 			cache:false,
 			ok: function(){
 				iframe = this.iframe.contentWindow;
 				var result = iframe.getSelected();
 				var row = result[0];
 				$("#no").val(row.no);
 				$("#name").val(row.name);
 				$("#labId").val(row['lab.id']);
 				$("#labName").val(row['lab.name']);
 				$("#teacherId").val(row['holder.id']);
 				$("#teacherName").val(row['holder.realName']);
 				$("#itemId").val(row['teachItem.id']);
 				$("#itemName").val(row['teachItem.itemName']);
 				$("#balance").val(row.balance);
 				$("#unit").val(row.unit);
 				$(":radio[value='"+ row['state.value']+"']").attr('checked','true');
 				$("#location").val(row.location);
 				$("#moneyFrom").val(row.moneyFrom);
 				$("#useDesc").val(row.useDesc);
 				$("#provider").val(row.provider);
 				$("#phone").val(row.phone);
 				$("#server").val(row.server);
 				$("#remarkLabel").val(row.remark);
 				$("#id").val(row.id);
 				$('#model').val(row.model);
 				return true;	
 			},
 			cancelVal: '关闭',
 			cancel: true /*为true等价于function(){}*/,
 		});	
 	}
 </script>
 <body>
  <t:formvalid formid="formobj" dialog="true" usePlugin="password" layout="table" action="changeApplyController.do?doAdd" tiptype="3">
		<input id="id" name="id" type="hidden">
		<table style=" " cellpadding="0" cellspacing="1" class="formtable">
			<tr>
				<td align="right">选择设备</td>
				<td class="value" colspan="3">
					<button type="button" onclick="selectDevice()">选择</button>
					<span class="Validform_checktip"></span>
					<label class="Validform_label" style="display: none;">设备</label>
				</td>
			</tr>
				<tr>
					<td align="right">
					<label class="Validform_label">
						编号:
					</label>
					</td>
					<td class="value">
				     	 <input id="no" name="no" type="text" style="width: 150px" value="${obj.no }"
				     	  class="inputxt"  datatype="*" onkeypress="specialTextValidate()" maxlength="100">
						<span class="Validform_checktip"></span>
						<label class="Validform_label" style="display: none;">编号</label>
					</td>		
						
					<td align="right">
						<label class="Validform_label">
							设备名称:
						</label>
					</td>
					<td class="value">
					     	 <input id="name" name="name" type="text" style="width: 150px" value="${obj.name }"
					     	  class="inputxt"  datatype="*" onkeypress="specialTextValidate()" maxlength="100">
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">设备名称</label>
					</td>
				</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							实验室:
						</label>
					</td>
					<td class="value"> 
                	     <input id="labId" name="labId" type="hidden" value="${obj.lab.id }">               
					     <input id="labName"  type="text" style="width: 150px" class="inputxt" readonly="readonly" datatype="*" value="${obj.lab.name }">
					     <t:choose textname="name" inputTextname="labName" hiddenName="labId" hiddenid="id" url="labController.do?goSelect" name="labList" 
                          icon="icon-search" title="选择实验室"  isclear="false" isInit="true" width="470px"></t:choose>
						<span class="Validform_checktip"></span>
						<label class="Validform_label" style="display: none;">实验室</label>						
					</td>
					<td align="right">
						<label class="Validform_label">
							设备所属项目:
						</label>
					</td>
					<td class="value"> 
                	     <input id="itemId" name="itemId" type="hidden" value="${obj.teachItem.id }">               
					     <input id="itemName"  type="text" style="width: 150px" class="inputxt" readonly="readonly" value="${obj.teachItem.itemName }">
					     
					     <t:choose textname="itemName" inputTextname="itemName" hiddenid="id" hiddenName="itemId"  url="dictTeachItemController.do?goSelect" name="groupList"
                          icon="icon-search" title="选择实验室"  isclear="false" isInit="true" width="470px"></t:choose>
					     
						<span class="Validform_checktip"></span>
						
					</td>
				</tr>	
				<tr>
					<td align="right">
						<label class="Validform_label">
							图片:
						</label>
					</td> 
					<td class="value" colspan="3"> 
		         		 <div id="wrapper">
					        <div id="container">
					            <div id="uploader">
					                <div class="queueList">
					                    <div id="dndArea" class="placeholder">
					                        <div id="filePicker"></div>
					                        <p>请选择图片文件，不能超过5M</p>
					                    </div>
					                </div>
					                <div class="statusBar" style="display:none;">
					                    <div class="progress">
					                        <span class="text">0%</span>
					                        <span class="percentage"></span>
					                    </div><div class="info"></div>
					                    <div class="btns">
					                        <div id="filePicker2"></div><div class="uploadBtn">开始上传</div>
					                    </div>
					                </div>
					            </div>
					        </div>
   						</div>
		           </td> 
			  </tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							数量:
						</label>
					</td>
					<td class="value">
					     	 <input id="balance" name="balance" type="text" style="width: 150px" value="${obj.balance }"
					     	 class="inputxt" onkeypress="specialTextValidate()" maxlength="100" datatype='n' maxlength="30">
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">数量</label>
					</td>
					<td align="right">
						<label class="Validform_label">
							单位:
						</label>
					</td>
					<td class="value">
					     	 <input id="unit" name="unit" type="text" style="width: 150px" class="inputxt" maxlength="50" value="${obj.unit }">
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">单位</label>
					</td>
				</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							所属管理员:
						</label>
					</td>
					<td class="value">
					     <input id="teacherId" name="teacherId" type="hidden" value="${obj.holder.id }">               
					     <input id="teacherName"  type="text" style="width: 150px" class="inputxt" readonly="readonly" datatype="*">
					     
					     <t:choose textname="realName" inputTextname="teacherName" hiddenid="id" hiddenName="teacherId"  url="teacherController.do?goSelect" name="teacherList"
                          icon="icon-search" title="选择教师"  isclear="false" isInit="true" width="470px"></t:choose>
					     
						<span class="Validform_checktip"></span>
						<label class="Validform_label" style="display: none;">所属管理员</label>				
					</td> 
					<td align="right">
						<label class="Validform_label">
							状态:
						</label>
					</td>
					<td class="value">
							  <t:enumSelect field="stateValue" type="radio" defaultVal="${obj.state.value }"
									  hasLabel="false"  enumClass="com.mengtian_tech.smart_lab.entity.device.DeviceState"
									  title="状态"></t:enumSelect>     
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">状态</label>
					</td>
				</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							位置:
						</label>
					</td>
					<td class="value"> 
							<input id="location" name="location" type="text" style="width: 150px" value="${obj.location }"
					     	 class="inputxt" onkeypress="specialTextValidate()" maxlength="100">
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">位置</label>
					</td>
					<td align="right">
						<label class="Validform_label">
							用途:
						</label>
					</td>
					<td class="value">
					    <input id="useDesc" name="useDesc" type="text" style="width: 150px" class="inputxt" maxlength="100" value="${obj.useDesc }">
						<span class="Validform_checktip"></span>
						<label class="Validform_label" style="display: none;">用途</label>
					</td> 
				</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							供应商名称:
						</label>
					</td>
					<td class="value">
					     	 <input id="provider" name="provider" type="text" style="width: 150px" class="inputxt" value="${obj.provider }">
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">供应商名称</label>
					</td>
					<td align="right">
						<label class="Validform_label">
							联系电话:
						</label>
					</td>
					<td class="value">
					     	 <input id="phone" name="phone" type="text" style="width: 150px" class="inputxt" maxlength="100" value="${obj.phone }">
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">联系电话</label>
					</td>
				</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							服务人员名称:
						</label>
					</td>
					<td class="value">
					     	 <input id="server" name="server" type="text" style="width: 150px" class="inputxt" maxlength="100" value="${obj.server }">
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">服务人员名称</label>
						</td>
					<td align="right">
						<label class="Validform_label">
							资金来源:
						</label>
					</td>
					<td class="value">
					     	 <input id="moneyFrom" name="moneyFrom" type="text" value="${obj.moneyFrom }"
					     	 style="width: 150px" class="inputxt" maxlength="100">
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">资金来源</label>
					</td> 
					
				</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							型号:
						</label>
					</td>
					<td class="value">
						<input id="model" name="model" type="text" class="inputxt" />  
						<span class="Validform_checktip"></span>
						<label class="Validform_label" style="display: none;">型号</label>
					</td>
					<td align="right">
						<label class="Validform_label">
							维修信息:
						</label>
					</td>
					<td class="value">
					 <textarea rows="" cols="" id="remarkLabel" readonly="readonly"></textarea>
		 		  	 <textarea style="width:300px;height:100px;" class="inputxt" rows="6" id="remark" name="remark" maxlength="200">${obj.remark }</textarea>
						<span class="Validform_checktip"></span>
						<label class="Validform_label" style="display: none;">维修信息</label>
					</td>
				</tr>
			</table>
		</t:formvalid>
		   <link rel="stylesheet" type="text/css" href="plug-in/webUploader/css/webuploader.css" />
    <link rel="stylesheet" type="text/css" href="plug-in/webUploader/style.css" />
    <script type="text/javascript" src="plug-in/webUploader/dist/webuploader.js"></script>
     <script type="text/javascript" src="plug-in/webUploader/third/uploadImg.js"></script>  
		
		<script>
			
			 $(document).ready(function () { 
				$('#filePicker2').hide();  
			});
			
			function  uploaderReady(){
				window.uploader.options.fileNumLimit =1;
			}
			 
			function deleteAttach(id){
				 $('#prevImg'+id).remove();
				 $('#formobj').append("<input type='hidden' name='deletedAttach'  value='"+id+"'/>");
			}
		 
		</script>
 </body>